<?php


namespace app\voip\func;


use app\voip\model\EHomeAddress;

class HomeAddressFunc
{
    /**
     * @param $data
     * @return array|false
     * @throws \Exception
     */
    static public function addAll($data)
    {
        $obj=new EHomeAddress();
        return $obj->saveAll($data);
    }

    /**
     * @param $data
     * @return EHomeAddress
     */
    static public function add($data)
    {
        return EHomeAddress::create($data);
    }

    /**
     * @param $where
     * @param $count
     * @return array|false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static public function selectCount($where, $count)
    {
        $obj = new EHomeAddress();
        return $obj->where($where)->order('id desc')->limit(0,$count)->select();
    }
}